<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML>
<html>
<head>
<title>智能菜场系统</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords"
	content="Gifty Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript">
addEventListener("load", function() {
	setTimeout(hideURLbar, 0);
}, false);
function hideURLbar() {
	window.scrollTo(0, 1);
}</script>
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<!-- Custom Theme files -->
<link href="css/style.css" rel='stylesheet' type='text/css' />
<link rel="stylesheet" href="css/jquery.countdown.css" />
<!-- Custom Theme files -->
<!--webfont-->
<%--<link href='http://fonts.useso.com/css?family=Raleway:100,200,300,400,500,600,700,800,900' rel='stylesheet' type='text/css'>--%>
<script type="text/javascript" src="js/jquery-1.11.1.min.js">
</script>
<!-- dropdown -->
<script src="js/jquery.easydropdown.js">
</script>
<!-- start menu -->
<link href="css/megamenu.css" rel="stylesheet" type="text/css"
	media="all" />
<script type="text/javascript" src="js/megamenu.js">
</script>
<script>
$(document).ready(function() {
	$(".megamenu").megamenu();
});</script>
<script src="js/responsiveslides.min.js">
</script>
<script>
$(function () {
      $("#slider").responsiveSlides({
      	auto: true,
      	nav: false,
      	speed: 500,
        namespace: "callbacks",
        pager: true,
      });
    });


</script>
<script src="js/jquery.countdown.js">
</script>
<script src="js/script.js">
</script>
</head>
<body>
	<jsp:include page="/font/top.jsp"></jsp:include>
	<div class="index_slider">
		<div class="container">
			<div class="callbacks_container">
				<ul class="rslides" id="slider">
					<li><img src="images/slider1.jpg" class="img-responsive"
						alt="" /></li>
					<li><img src="images/2.jpg" class="img-responsive" alt="" />
					</li>
					<li><img src="images/3.jpg" class="img-responsive" alt="" />
					</li>
				</ul>
			</div>
		</div>
	</div>
	<div class="content_top">
		<div class="container">
			<div class="grid_1">
				<div class="col-md-3">
					<div class="box2">
						<ul class="list1">
							<i class="lock"> </i>
							<li class="list1_right">
								<p>高达5%的奖励你的航运</p>
							</li>
							<div class="clearfix"></div>
						</ul>
					</div>
				</div>
				<div class="col-md-3">
					<div class="box3">
						<ul class="list1">
							<i class="clock1"> </i>
							<li class="list1_right">
								<p>更加方便退货</p>
							</li>
							<div class="clearfix"></div>
						</ul>
					</div>
				</div>
				<div class="col-md-3">
					<div class="box4">
						<ul class="list1">
							<i class="vehicle"> </i>
							<li class="list1_right">
								<p>免费送货订单超过99元</p>
							</li>
							<div class="clearfix"></div>
						</ul>
					</div>
				</div>
				<div class="col-md-3">
					<div class="box5">
						<ul class="list1">
							<i class="dollar"> </i>
							<li class="list1_right">
								<p>准时送达到你手中</p>
							</li>
							<div class="clearfix"></div>
						</ul>
					</div>
				</div>
				<div class="clearfix"></div>
			</div>

			<form action="index.action" method="post">
				菜品名称:<input name="name">&nbsp;价格:<input name="price">-<input
					name="price1">&nbsp;<input type="submit" value="查询" />
			</form>
			<div class="grid_2">

				<c:forEach var="item" items="${cpzs}">
					<div class="col-md-3 span_6">
						<div class="box_inner">
							<a href="product-info.action?entity.id=${item.id}"><img
								src="${item.filepath}" class="img-responsive" alt="" /></a>
							<div class="sale-box"></div>
							<div class="desc">
								<h3 align="left">&nbsp;${item.name} 单位:${item.size}
									单价:${item.ext2}-</h3>
								<%--								<h4>--%>
								<%--									--%>
								<%--								</h4>--%>
								<ul class="list2">
									<li class="list2_left"><span class="m_1"><a
											href="javascript:addWishList('${item.id}')" class="link">加入购物车
										</a> </span></li>
									<li class="list2_right"><span class="m_2"> <%--										<a href="#" class="link1">SeeMore</a>--%>
									</span></li>
									<div class="clearfix"></div>
								</ul>
								<%--								<div class="heart"></div>--%>
							</div>
						</div>
					</div>
				</c:forEach>
				<div class="clearfix"></div>
			</div>
		</div>
	</div>


	<jsp:include page="/font/foot.jsp"></jsp:include>
	<script type="text/javascript">
	function addWishList(id){
		var name = prompt("请输入您数量", ""); //将输入的内容赋给变量 name ，  
  
        //这里需要注意的是，prompt有两个参数，前面是提示的话，后面是当对话框出来后，在对话框里的默认值  
        if (!name){//如果返回的有内容  
            alert("请务必填写购买数量!");
        	return;
        }  
		$.ajax({
		    url:'json/wish-addwishlist.action',
		    type:'GET', //GET
		    async:true,    //或false,是否异步
		    data:{
		        "product.id":id,
		        "product.ext1":name
		    },
		    timeout:5000,    //超时时间
		    dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
		   
		    success:function(data,textStatus,jqXHR){
		      alert(data.message);
		    },
		    error:function(XMLHttpRequest,textStatus,errorThrown){
		    	alert("--");
		    }
		});
	}
	</script>
</body>

</html>
